package com.burstly.lib.constants;

import android.content.Context;
import android.content.res.AssetManager;
import android.util.Log;
import com.burstly.lib.BurstlySdk;
import com.burstly.lib.exception.BurstlySdkNotInitializedException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public final class BurstlyProperties
{
  public static final String TAG = BurstlyProperties.class.getName();
  private static volatile boolean sIsLoaded;
  private static Properties sProperties = new Properties();

  private static void close(InputStream paramInputStream)
  {
    if (paramInputStream != null);
    try
    {
      paramInputStream.close();
      return;
    }
    catch (IOException localIOException)
    {
    }
  }

  public static String getString(String paramString)
  {
    if (BurstlySdk.wasInit())
    {
      if (sIsLoaded)
        return sProperties.getProperty(paramString, "Can not find property with key :" + paramString);
      return "Property file is not initialized!";
    }
    throw new BurstlySdkNotInitializedException();
  }

  public static void initProperties(Context paramContext)
  {
    if (!sIsLoaded)
    {
      loadPropertiesFromFile(paramContext, "burstly.properties");
      loadPropertiesFromFile(paramContext, "version.properties");
      sIsLoaded = true;
    }
  }

  private static void loadPropertiesFromFile(Context paramContext, String paramString)
  {
    AssetManager localAssetManager = paramContext.getAssets();
    InputStream localInputStream = null;
    try
    {
      localInputStream = localAssetManager.open(paramString);
      sProperties.load(localInputStream);
      return;
    }
    catch (Exception localException)
    {
      Log.e(TAG, "FATAL ERROR! Application could not find properties file: " + paramString);
      return;
    }
    finally
    {
      close(localInputStream);
    }
  }

  static final class PropertyKey
  {
    static final String AD_SERVER_URI = "connect.adServerList";
    static final String BUILD_ID = "buildID";
    static final String CONFIGURATION_URI = "connect.confService";
    static final String CONTENT_ROOT = "connect.contentRoot";
    static final String CURRENCY_PRIMARY_HOST = "currency.host";
    static final String CURRENCY_SECURED_POINT = "currency.encrypted.point";
    static final String CURRENCY_SERVER_LIST = "connect.serverList";
    static final String GLOBAL_ADAPTOR_TIMEOUT = "globalAdaptorTimeout";
    static final String IS_DEBUG_MODE = "isDebug";
    static final String PRIMARY_HOST = "connect.singleAdHost";
    static final String SDK_VERSION = "sdk.version";
    static final String SINGLE_AD_URI = "connect.singleAdUri";
    static final String SINGLE_DOWNLOAD_TRACK_URI = "connect.singleDownloadTrackUri";
    static final String SINGLE_TRACK_CLICK_URI = "connect.singleTrackClickUri";
    static final String SINGLE_TRACK_URI = "connect.singleTrackUri";
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.burstly.lib.constants.BurstlyProperties
 * JD-Core Version:    0.6.2
 */